package com.spzx.product.api.factory;

import com.spzx.common.core.domain.R;
import com.spzx.product.api.RemoteBrandAllService;
import com.spzx.product.api.domain.Brand;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;
@Component
public class RemoteBrandAllFallbackFactory implements FallbackFactory<RemoteBrandAllService> {
    @Override
    public RemoteBrandAllService create(Throwable cause) {
        return new RemoteBrandAllService(){
            @Override
            public R<List<Brand>> getBrandAll(String s) {
                return R.fail("查询品牌失败");
            }
        };

    }
}
